package com.example.demo.controller;

import com.baidu.bas.core.annotation.EruptRecordOperate;
import com.baidu.bas.core.constant.EruptRestPath;
import com.baidu.bas.core.controller.EruptModifyController;
import com.baidu.bas.core.service.IEruptDataService;
import com.baidu.bas.core.view.EruptApiModel;
import com.deepzero.mmma.channel.SendResult;
import com.example.demo.service.TryService;
import com.example.demo.vo.tyy.News;
import com.example.demo.vo.tyy.Template;
import com.google.gson.JsonObject;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.mp.bean.result.WxMpUser;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.transaction.Transactional;
import java.util.List;
import java.util.Optional;

/**
 * 测试发送
 * @author liuzhenchuan@foxmail.com
 * @date 2021/1/6
 */
@RestController
@RequestMapping(EruptRestPath.ERUPT_API + "/nest/")
@Slf4j
public class Nest {

    @Resource
    private EruptModifyController eruptModifyController;

    @PutMapping({"/start/{erupt}"})
    @EruptRecordOperate(desc = "开启")
    @Transactional
    public EruptApiModel start(@PathVariable("erupt") String erupt,
                               @RequestBody String jsonData, JsonObject jsonObject
            , HttpServletRequest request, HttpServletResponse response) throws IllegalAccessException, InstantiationException {
        return eruptModifyController.editEruptData(erupt, jsonData,request,response);
    }

}
